package com.sw.youvote.shared.objects;

import java.io.Serializable;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;



@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class CandidatureBean implements Serializable {
	
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
    private String encodedKey; 
	
	@Persistent  
	private QuizBean quiz;  
		
	public QuizBean getQuiz() {
		return quiz;
	}



	public void setQuiz(QuizBean quiz) {
		this.quiz = quiz;
	}

	@Persistent
	private String name;
	
	@Persistent
	private String description;
	
	@Persistent
	private String imageurl;
	
	@Persistent
	private String creatormail;
	
	@Persistent
	private int numberVotes;

	public CandidatureBean() {
		
	}

	

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getImageurl() {
		return imageurl;
	}

	public void setImageurl(String imageurl) {
		this.imageurl = imageurl;
	}

	public String getCreatormail() {
		return creatormail;
	}

	public void setCreatormail(String creatormail) {
		this.creatormail = creatormail;
	}

	public int getNumberVotes() {
		return numberVotes;
	}

	public void setNumberVotes(int numberVotes) {
		this.numberVotes = numberVotes;
	}


	public String toString() {
		StringBuffer sb = new StringBuffer();
		
		sb.append("[");
		sb.append("encodedKey");
		sb.append("=");
		sb.append(this.encodedKey);
		sb.append(",");
		sb.append("name");
		sb.append("=");
		sb.append(this.name);
		sb.append(",");
		sb.append("description");
		sb.append("=");
		sb.append(this.description);
		sb.append(",");
		sb.append("creatormail");
		sb.append("=");
		sb.append(this.creatormail);
		sb.append(",");
		sb.append("imageurl");
		sb.append("=");
		sb.append(this.imageurl);
		sb.append(",");
		sb.append("quizId");
		sb.append("=");
		sb.append((quiz!=null)?quiz.getId():"null");
		
		sb.append("]");
		return sb.toString();
	}
	
	
	
}
